// components/MyNavigator/MyNavigator.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        tabs:{
          type:Array,
          value:[]
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
    
    },

    /**
     * 组件的方法列表
     */
    methods: {
        handleItemTap(e){
            let {item} = e.target.dataset;
           
            let tabs = this.data.tabs; 
            tabs.forEach(el => {
              
                if(el.id === item){
                    el.isActive = true;
                }else{
                    el.isActive = false;
                }
                console.log(el);
            });


            this.setData({
                tabs
            });

            // changeIndex
            this.triggerEvent("changeIndex",{index:item});

        }

    }
})
